using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Husb.WinForm.Controls
{
    public class DataGridViewDateCell : DataGridViewTextBoxCell
    {
        protected override object GetFormattedValue(object value, int rowIndex, ref DataGridViewCellStyle cellStyle, System.ComponentModel.TypeConverter valueTypeConverter, System.ComponentModel.TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)
        {
            object o = base.GetFormattedValue(value, rowIndex, ref cellStyle, valueTypeConverter, formattedValueTypeConverter, context);

            return DateTime.Parse(o.ToString()).ToString("yyyy-MM-dd");
        }
    }
}
